/**
 * 版权所有 2009-2015 中国中医科学院中医药信息研究所 何前锋 frontpeak@yahoo.com.cn
 **/
package cn.ac.cintcm.sh.domain;

public class Dosage implements Comparable {

    private String name;
    private Unit unit;
    
    
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Unit getUnit() {
        return unit;
    }
    public void setUnit(Unit unit) {
        this.unit = unit;
    }
    
    public int compareTo(Object ds) {
        int compare = 0;
        if (ds != null && ds instanceof Dosage) {
            Dosage d = (Dosage) ds;
            compare = (int) ((d.getUnit().getQuantity() - this.getUnit().getQuantity()) * 100);
        }
        return compare;
    }
    
}